#ifndef __UART_H__
#define __UART_H__

#include "typedef.h"

#define USART_RX_LEN 20  
#define USART_TX_LEN 20

#define USB_debug 1
#if USB_debug
#define pr_dbg(x) USART_SendStr(x)
#define pr_hex_dbg(x) pr_hex(x)
#else
#define pr_dbg(x)
#define pr_hex_dbg(x)
#endif

typedef struct     
{
    u8 RX_BUFF[USART_RX_LEN]; //接收缓存
    u8 TX_BUFF[USART_TX_LEN]; //发送缓存
    u16 RX_COUNT;
}USART;

void USART_Configure(void);
void USART_SendByte(u8 dat);
void USART_Send(u8* arr,u16 len);
void USART_SendStr(u8* str);
void pr_hex(u8 x);

#endif
